<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Load content by region and side (load from model)
 */
function render($region = 'home', $side = '')
{
    if($side == '') return 0;
    $strSQL = "SELECT * FROM babycms_blocks 
        WHERE region = '$region' AND side = '$side' AND status = '1' ORDER BY weight ASC";
    $query = mysql_query($strSQL);
    while($rows = mysql_fetch_array($query))
    {
        echo Modules::run($rows['func']);
    }     
}

function encrypt($str)
{
    $en = new CI_Encrypt();
    return $en->encode($str);
}
function decrypt($str)
{
    $en = new CI_Encrypt();
    return $en->decode($str);
    
}